package kt.base

fun main() {
    empty0Test()
}

fun emptyTest(){
    var list : List<String>? = null

    if (list?.isNullOrEmpty()!!){           // ava.lang.NullPointerException
        print("is null ***")
    }else{
        print(" not   is  null    ... ")
    }

}



fun emptyNullTest(){
    var list : List<String>? = null

    if (list.isNullOrEmpty()){           // 通过
        print("is null ***")
    }else{
        print(" not   is  null    ... ")
    }

}



fun empty0Test(){
    var list : List<String>? =  arrayListOf()

    if (list.isNullOrEmpty()){
        print("is null ***")
    }else{
        print(" not   is  null    ... ")
    }

    // is null ***

}






